{
  // 对象类型 => 就是在描述对象的属性以及方法

  type ObjType = {
    name: string
    age: number
    // 函数名
    sayHi(username: string): void
  }
  const obj: ObjType = {
    name: 'zs',
    age: 23,
    sayHi(username) {
      console.log('你好', this.name)
    },
  }

  obj.age
  obj.name
  obj.sayHi('ls')

  // 提示报错+代码提示
  console.log(obj.age, obj.name, obj.sayHi('ls'))
}

{
  type TypeStu = {
    name: string
    sex: string
    score: number
    hight: number
    // 函数名(): 返回值类型
    // study(learn: string): void
    // game(): void

    // 函数名: () => 返回值类型

    study: (learn: string) => void
    game: () => void
  }
  const student: TypeStu = {
    name: 'lw',
    sex: '男',
    score: 150,
    hight: 180,

    study(learn) {
      console.log('学习努力', learn)
    },
    game() {
      console.log('非常会打游戏')
    },
  }

  student.game
  student.study('1')
  student.game()
}
